class Animal {
    public String name;
    public int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat() {
        System.out.println(this.name + "正在吃饭");
    }
}

class Dog extends Animal {
    public Dog(String name, int age) {
        super(name, age);
    }
    public void bark() {
        System.out.println(this.name + "汪汪叫");
    }
    public void eat() {
        System.out.println(this.name + "正在吃狗粮");
    }
}

class Cat extends Animal {
    public Cat(String name, int age) {
        super(name, age);
    }
    public void miaomiao() {
        System.out.println(this.name + "喵喵叫");
    }
}

public class New {
    public static void main(String[] args) {
        Animal animal = new Dog("yuanyuan", 10);

        if (animal instanceof Cat) {
            Cat cat = (Cat)animal;
        }else {
            System.out.println("理解了！");
        }
    }
    public static void eatFun(Animal animal) {
        animal.eat();
    }
    public static void main1(String[] args) {
        Animal dog = new Dog("yuanyuan", 10);

        //Dog dog1 = dog;
        Dog dog1 = (Dog)dog;

        dog1.bark();
    }
}
